import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
import React from "react";
import classes from "./invitationCode.module.less";
import SecondaryLayout from "../../compoents/secondary-layout";
import CustomInput from "../../compoents/input";
import classNames from "classnames";
import { useLockFn, useReactive } from "ahooks";
import { useTranslation } from "react-i18next";
import { LocalKeyMap } from "../../local";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
function InvitationCode() {
    var state = useReactive({
        code: ""
    });
    var skip = function() {};
    var enter = useLockFn(/*#__PURE__*/ _async_to_generator(function() {
        return _ts_generator(this, function(_state) {
            if (!state.code) return [
                2
            ];
            try {} catch (e) {}
            return [
                2
            ];
        });
    }));
    var t = useTranslation().t;
    return /*#__PURE__*/ _jsx(SecondaryLayout, {
        title: t(LocalKeyMap["invitation.title"]),
        children: /*#__PURE__*/ _jsxs("div", {
            className: classes.invitation_code,
            children: [
                /*#__PURE__*/ _jsx(CustomInput, {
                    value: state.code,
                    onChange: function(val) {
                        state.code = val;
                    },
                    clear: true,
                    className: classes.input,
                    placeholder: t(LocalKeyMap["invitation.placeholder"]),
                    maxLength: 6,
                    showMaxLength: true
                }),
                /*#__PURE__*/ _jsx("div", {
                    className: classes.tip,
                    children: t(LocalKeyMap["invitation.desc"])
                }),
                /*#__PURE__*/ _jsxs("div", {
                    className: classes.options,
                    children: [
                        /*#__PURE__*/ _jsx("div", {
                            className: classNames(classes.btn, state.code ? "" : classes.btn_disabled),
                            onClick: enter,
                            children: /*#__PURE__*/ _jsx("span", {
                                children: t(LocalKeyMap.enter)
                            })
                        }),
                        /*#__PURE__*/ _jsx("div", {
                            onClick: skip,
                            className: classNames(classes.btn, classes.skip),
                            children: /*#__PURE__*/ _jsx("span", {
                                children: t(LocalKeyMap.skip)
                            })
                        })
                    ]
                })
            ]
        })
    });
}
export default InvitationCode;

 //# sourceMappingURL=index.js.map